# !ResCreate Makefile

# ****** EDIT MAKEPROTO, NOT MAKEFILE ******
# Then construct Makefile using "amu -f MakeProto depend"

# INSTDIR should be set to the application's install directory

# Can set:
#  CFLAGS     -  additional cc options
#  LDFLAGS    -  additional link options

INCLUDES = -IC:

CPFLAGS = A~C~DF~L~N~P~Q~R~S~T~V

LIBS = C:o.toolboxlib C:o.eventlib C:o.wimplib C:o.Stubs

CFILES = alloc.c debug.c error.c main.c message.c dbox.c

OFILES = alloc.o debug.o error.o main.o message.o dbox.o

FILES = !Help !Run !RunImage !Sprites !Sprites22 Messages Res

all: !RunImage
        @echo *** ResCreate build complete

!RunImage: $(OFILES)
        link $(LDFLAGS) -o $@ $(OFILES) $(LIBS)
        squeeze $@

.c.o:
        cc -c $(CFLAGS) $(INCLUDES) -o $@ $<

install: $(FILES)
        cdir $(INSTDIR).!ResCreate
        copy !Help $(INSTDIR).!ResCreate.!Help $(CPFLAGS)
        copy !Run $(INSTDIR).!ResCreate.!Run $(CPFLAGS)
        copy !RunImage $(INSTDIR).!ResCreate.!RunImage $(CPFLAGS)
        copy !Sprites $(INSTDIR).!ResCreate.!Sprites $(CPFLAGS)
        copy !Sprites22 $(INSTDIR).!ResCreate.!Sprites22 $(CPFLAGS)
        copy Messages $(INSTDIR).!ResCreate.Messages $(CPFLAGS)
        copy Res $(INSTDIR).!ResCreate.Res $(CPFLAGS)
        @echo *** ResCreate installation complete

depend:
        copy MakeProto Makefile1 $(CPFLAGS)
        cc -c -M $(INCLUDES) $(CFILES) >> Makefile1
        remove Makefile0
        -rename Makefile Makefile0
        rename Makefile1 Makefile
        @echo *** ResCreate dependencies established

clean:
       create o.foo
       wipe o.* ~CRF~V
       remove !RunImage
       @echo *** ResCreate cleaned

# Dependencies following this line provided by make depend

